<template>
  <div class="loading" v-show="value">
    <div class="loading-content">
      <i class="iconfont icon-jiazai"></i>
    </div>
  </div>
</template>

<script>
export default {
  name: 'loading',
  props: {
    value: {
      type: Boolean,
      default: true,
    },
  },
};
</script>

<style lang="scss" scoped>
.loading {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  .loading-content {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    text-align: center;
    i {
      display: inline-block;
      font-size: 50px;
      color: #ffffff;
      opacity: .3;
      animation: loading-rotate 2s linear infinite;
    }
  }
}
//动画函数
@keyframes loading-rotate {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
</style>
